﻿<template>
    <elm-page-tb>
        <template #top>
            <el-input placeholder="请查询输入内容" prefix-icon='el-icon-search' size="mini" style="width: 250px;" v-model="postData.name" clearable></el-input>
            <right>
                <el-button-group>
                    <el-button icon="el-icon-search" size="mini" @click="treebinding()">查询</el-button>
                    <elm-open-button url="org_edit" width="700" height="450" title="新增" :data="{ pid: '0' }" icon="el-icon-edit" size="mini">新增</elm-open-button>
                </el-button-group>
            </right>
        </template>
        <elm-table-tree url="/system/org/GetTree" :post-data="postData" :default-expand-all="true" height="100%">
            <el-table-column type="index" label="序号" width="60px" align="center"></el-table-column>
            <el-table-column prop="name" label="单位名称" width="300px" :sortable='true'></el-table-column>
            <el-table-column prop="leader" label="联系人" :sortable='true'></el-table-column>
            <el-table-column prop="phone" label="联系电话" align="center"></el-table-column>
            <el-table-column prop="cost_type" label="成本归集" align="center"></el-table-column>
            <el-table-column prop="sort" label="顺序" align="center" width="100px"></el-table-column>
            <el-table-column fixed="right" label="操作" width="180px" align="center">
                <template v-slot="scope">
                    <elm-open-button url="org_edit"  width="700" height="450" title="编辑" :data="{ model: scope.row }" type="text">编辑</elm-open-button>
                    <elm-open-button url="org_edit"  width="700" height="450" :title="'新增[' + scope.row.name + ']的下级模块'" :data="{ pid: scope.row.id }" type="text">新增下级</elm-open-button>
                    <elm-delete-button type="text" size="mini" url="/system/org/Delete" :data="{ id: scope.row.id }">删除</elm-delete-button>
                </template>
            </el-table-column>
        </elm-table-tree>
    </elm-page-tb>
</template>

<script>
    export default {
        extends: elmVueBase,
        data() {
            return {
                postData: { name: null },
            }
        },
        created() {
        },
        methods: {
        }
    }
</script>

<style scoped>
</style>